"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const taro_1 = require("@tarojs/taro");
const taro_ui_1 = require("taro-ui");
const components_1 = require("@tarojs/components");
const YContentPadded_1 = require("../../../components/YContentPadded");
const YTableDivider_1 = require("../../../components/YTableDivider");
const cloverActive_2x_png_1 = require("../../../assets/cloverActive@2x.png");
require("./Records.scss");
class default_1 extends taro_1.Component {
    constructor() {
        super(...arguments);
        this.config = {
            navigationBarTitleText: '我的中奖纪录',
            enablePullDownRefresh: true,
            backgroundColor: '#ccc'
        };
        this.state = {
            isOpened: false
        };
        this.onClick = (msg) => {
            console.log(msg, 123);
        };
    }
    componentWillMount() {
        taro_1.default.login().then(msg => console.log(msg));
    }
    onPullDownRefresh() {
        console.log('--------下拉刷新-------');
        taro_1.default.showNavigationBarLoading(); //在标题栏中显示加载
        setTimeout(() => {
            // complete
            taro_1.default.hideNavigationBarLoading(); //完成停止加载
            taro_1.default.stopPullDownRefresh(); //停止下拉刷新
        }, 2000);
    }
    onReachBottom() {
        this.setState(state => (Object.assign({}, state, { isOpened: true })));
        console.log('--------上拉刷新-------');
        setTimeout(() => {
            taro_1.default.stopPullDownRefresh(); //停止下拉刷新
            this.setState(state => (Object.assign({}, state, { isOpened: false })));
        }, 2000);
    }
    render() {
        return (<components_1.View className='GoodsUserProfile'>
        <taro_ui_1.AtToast isOpened={this.state.isOpened} text='加载中...' status='loading' hasMask={true}/>
        <YTableDivider_1.default title='奖品一：阳澄湖大闸蟹'/>
        <components_1.View className='tableCell'>
          <components_1.View className='title'>
            <components_1.Text className='text'>我种下的幸运草</components_1.Text>
          </components_1.View>
          <components_1.View className='navigate'>
            <components_1.Image src={cloverActive_2x_png_1.default} mode='widthFix' className='icon'/>
            <components_1.Text className='text'>+56</components_1.Text>
          </components_1.View>
        </components_1.View>
        <YContentPadded_1.default>
          <taro_ui_1.AtList>
            {Array.from(new Array(30)).map((i, k) => (<taro_ui_1.AtListItem key={k} thumb='https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png' extraThumb='https://img12.360buyimg.com/jdphoto/s72x72_jfs/t6160/14/2008729947/2754/7d512a86/595c3aeeNa89ddf71.png' extraText='+56' note='2018/08/02' title='张晓东'/>))}
          </taro_ui_1.AtList>
        </YContentPadded_1.default>       
      </components_1.View>);
    }
}
exports.default = default_1;
//# sourceMappingURL=Records.bak.jsx.map